There are various methods for controlling on-off switching operations of switching elements to control harmonic current components, one of which is disclosed in Japanese Patent Publication No. 3852289. The disclosed method compares a command current value determined from a value of required torque and such harmonic current components with a carrier signal having an amplitude predetermined based on the amplitude of the sinusoidal command voltage. Then, the disclosed method performs pulse-width modulation (PWM) control based on the results of the comparison. The PWM control cyclically generates a drive pulse signal for driving each switching element while adjusting a duty cycle of the drive pulse signal based on the results of the comparison for each switching cycle.